<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<c:set var="basePath" value="${pageContext.request.contextPath}" scope="request"></c:set>
<html>
  <head>
    <title>欢迎登陆毅丝不挂 starting page</title>
	<meta http-equiv="pragma" content="no-cache">
	<meta http-equiv="cache-control" content="no-cache">
	<script type="text/javascript" src="js/js/Jquery.js"></script>
  </head>
  <script type="text/javascript">
  	$(document).ready( function(){
  		var $loginForm = $("#loginForm");
  		$('#btn').click(function(){
  			var data = $('#loginForm').serialize();
  			$.post("${basePath}/login!login.action", data ,function(datas){
  			alert(datas.status);
  			alert(datas.result);
  			window.location.href = datas.url;
  		},"json");
  		});
  		$('#seccodeImage').click(function(){
  			$('#seccodeImage').attr('src', '${basePath}/seccode.jsp?d='+new Date ( ) * 1 );
			$('#seccode').val('').focus();
  		});
  	});
  	
  </script>
  <body>
  <form action="" id="loginForm" method="post">
  	<table>
		<tr>
			<td>用户名：</td><td><input type="text" name="username" id="username"/></td>
		</tr>  
		<tr>
			<td>密码：</td><td><input type="password" name="pwd" id="pwd"/></td>
		</tr>
		<tr><td><input type="text" name="seccode" id="seccode"/></td><td>
		<img src="${basePath}/seccode.jsp" id="seccodeImage" /></td></tr>
		<tr>
			<td><input name="btn" id="btn" type="button" value="登陆"></td>
		</tr>	
  	</table>
  </form>
  </body>
</html>
